
<script setup>
// 1 导入ref
import { ref, watch } from "vue";

// 2 定义响应式数据 并给默认值
const msg = ref('');

watch(msg,()=>{
  console.log(`output->msg`,msg.value)
})
</script>

<template>
  <div id="app">
    <input type="text" v-model="msg">
       <p>{{msg}}</p>
</div>
</template>
<style    scoped>

</style>